/** 
Copyright (c) 2010, Sheikh Abdul Wahid Ahmed
Details @ http://extremecodeworld.codeplex.com/license
**/

using System;

namespace EXtremecode.Debugging
{
	/// <summary>
	/// Summary description for Debug.
	/// </summary>
	public class Debug
	{
		private static FrmGrid s_frmGrid=null;
		private static FrmText s_frmText=null;
		private static FrmExpression s_frmExpression=null;

		public static void ShowGrid(object dataSource)
		{
#if (!DEBUG)
			return;
#else
			if(s_frmGrid==null) s_frmGrid=new FrmGrid();
			s_frmGrid.DataSource=dataSource;
			s_frmGrid.ShowDialog();
#endif			
		}
		public static void ShowText(object text)
		{
#if (!DEBUG)
			return;
#else
			if(s_frmText==null) s_frmText=new FrmText();
			s_frmText.Text=text;
			s_frmText.ShowDialog();
			
#endif			
		}

		public static void VerifyExpression()
		{
			 VerifyExpression(null,null);
		}

		public static void VerifyExpression(string expression)
		{
			 VerifyExpression(expression,null);
		}
		public static void VerifyExpression(string expression,object inputString)
		{
#if (!DEBUG)
			return;
#else
			if(s_frmExpression ==null) s_frmExpression=new FrmExpression();
			s_frmExpression.Expression  = (expression==null)? string.Empty: expression ;
			s_frmExpression.InputString = (inputString==null)? string.Empty: inputString ;
			s_frmExpression.btn_Click(null,null);
			s_frmExpression.ShowDialog();
			
#endif			
		}

	}
}
